<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>北京航天公司固定资产管理系统</title>
</head>
<body>
<button class="layui-btn" id="return">返回</button>

    <button class="layui-btn" id="passBtn" th:if="${userInfo.rankNum} ==1" >审核通过</button>
    <button class="layui-btn" id="passBtn" th:if="${userInfo.rankNum} ==2" >审核通过</button>

    <button class="layui-btn layui-btn-danger" th:if="${session.userInfo.rankNum} ==1"  id="forbidBtn" >账目不符</button>
    <button class="layui-btn layui-btn-danger" th:if="${session.userInfo.rankNum} ==2" id="forbidBtn" >账目不符</button>
    <button class="layui-btn" id="repair" th:if="${userInfo.rankNum} ==1" >点击报修</button>



<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
    <ul class="layui-tab-title">
        <li class="layui-this">计划详情</li>
    </ul>
    <div class="layui-tab-content" style="height: 100px;">
        <input type="hidden" th:value="${userInfo.rankNum}" name="rankNum">
        <input type="hidden" th:value="${checkPlanVo.checkplanId}" name="checkplanId">
        <input type="hidden" th:value="${checkPlanVo.check_plan_statu}" name="check_plan_statu">
        <input type="hidden" th:value="${userInfo.uname}" name="final_approver_name">
        <input type="hidden" th:value="${checkPlanVo.checkplanName}" name="history_plan_name">
        <input type="hidden" th:value="${checkPlanVo.parsonMan}" name="plan_person_name">
        <div class="layui-tab-item layui-show">
            <div class="layui-inline">
                <div class="layui-col-xs6 layui-col-md4">
                    <blockquote class="layui-elem-quote" style="width: 1550px;">计划信息详情</blockquote><br>
                </div>
            </div>

            <form action="" class="layui-form">
                <div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 150px;">计划名称：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="email" readonly style="width: 261.988636px;"  th:value="${checkPlanVo.checkplanName}" lay-verify="email" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 150px;">计划类型：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="email" readonly style="width: 261.988636px;" th:value="${checkPlanVo.planTypeName}" lay-verify="email" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 150px;">当前状态：</label>
                        <div class="layui-input-inline">
                            <span  th:if="${checkPlanVo.checkstatusName}=='等待一级审批'" style="color: blue" th:text="'***等待一级审批***'"></span>
                            <span  th:if="${checkPlanVo.checkstatusName}=='等待二级审批'" style="color: blue" th:text="'***等待最终审批***'"></span>
                            <span  th:if="${checkPlanVo.checkstatusName}=='已驳回'" style="color: red" th:text="'***计划盘点以终止***'"></span>
                            <span  th:if="${checkPlanVo.checkstatusName}=='审批完成'" style="color: green" th:text="'***审批完成***'"></span>
                        </div>
                    </div>
                </div>
                <br><br>
                <div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 150px;">计划创建时间：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="email" readonly style="width: 261.988636px;" th:value="${checkPlanVo.checkstartTime}" lay-verify="email" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 150px;">计划结束日期：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="email" readonly style="width: 261.988636px;" th:value="${checkPlanVo.checkendTime}" lay-verify="email" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 150px;">计划负责人：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="email" readonly style="width: 261.988636px;" th:value="${checkPlanVo.parsonMan}" lay-verify="email" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
            </form>
            <br>





            <div class="layui-inline">
                <div class="layui-col-xs6 layui-col-md4">
                    <blockquote class="layui-elem-quote" style="width: 1550px;">盘点范围及提交日期</blockquote><br>
                </div>
            </div>

            <form action="" class="layui-form">
                <div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 150px;">计划启动日期：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="email" readonly style="width: 261.988636px;"  th:value="${checkPlanVo.planstartTime}" lay-verify="email" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 150px;">盘点部门：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="email" readonly style="width: 261.988636px;" th:value="${checkPlanVo.depName}" lay-verify="email" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 150px;">资产类别：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="email" readonly style="width: 261.988636px;" th:value="${checkPlanVo.propertyType}" lay-verify="email" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
            </form>
            <br>
            <div class="layui-collapse " lay-filter="test">
                <div class="layui-colla-item">
                    <h2 class="layui-colla-title">具体盘点信息</h2>
                    <div class="layui-colla-content">
                        <table class="layui-table" >
                            <thead>
                            <tr>
                                <th>资产编号</th>
                                <th>资产名称</th>
                                <th>资产状态</th>
                                <th>资产单位</th>
                                <th>资产类型</th>
                                <th>所属盘点计划</th>
                            </tr>
                            </thead>
                            <tboby>
                                <tr th:each="properTy : ${propertyVoList}">
                                    <td th:text="${properTy.property_id}"></td>
                                    <td th:text="${properTy.property_name}"></td>
                                    <td th:text="${properTy.statu_name}"></td>
                                    <td th:text="${properTy.property_unit}"></td>
                                    <td th:text="${properTy.property_tname}"></td>
                                    <td th:text="${properTy.checkplan_name}"></td>
                                </tr>
                            </tboby>
                        </table>
                    </div>
                </div>
            </div><br>


            <div th:if="${session.userInfo.rankNum}==1">
                <div class="layui-inline">
                    <div class="layui-col-xs6 layui-col-md4">
                        <blockquote class="layui-elem-quote" style="width: 1550px;">具体盈亏</blockquote><br>
                    </div>
                </div>
                <form id="formStand" action="" class="layui-form">
                    <div class="layui-input-inline">
                        <label class="layui-form-label">盘点结果：</label>
                        <div class="layui-input-inline">
                            <select name="result_id"  id="result_id" class="layui-form-select">
                                <option value="">---请选择结果---</option>
                                <option value="1">账目一致</option>
                                <option value="2">账目异常</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">盘点备注：</label>
                        <div class="layui-input-inline">
                            <textarea class="layui-form-text" name="remark"></textarea>
                        </div>
                    </div>
                    <button type="button" class="layui-btn" id="stand">提交具体盈亏</button>
                </form>
            </div>
            <div th:if="${session.userInfo.rankNum} == 2">
            <div class="layui-inline">
                <div class="layui-col-xs6 layui-col-md4">
                    <blockquote class="layui-elem-quote" style="width: 1550px;">具体盈亏</blockquote><br>
                </div>
            </div>
                <table class="layui-table" >
                    <thead>
                    <tr>
                        <th>对应资产编号</th>
                        <th>盘点状态</th>
                        <th>备注</th>
                    </tr>
                    </thead>
                    <tboby>
                        <tr th:each="remarkLi : ${remarkList}">
                            <td th:text="${remarkLi.check_id}"></td>
                            <td th:text="${remarkLi.result_name}"></td>
                            <td th:text="${remarkLi.remark}"></td>
                        </tr>
                    </tboby>
                </table>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="/js/jquery-1.8.2.js"></script>
<script type="text/javascript" src="/layui/layui.all.js"></script>
<link rel="stylesheet" href="/layui/css/layui.css">
<script>
    $("#return").click(function () {
        window.location.href="/jump/goShow"
    })


    /*通过*/
    $("#passBtn").click(function () {
        var rankNum = $("[name='rankNum']").val()
        var check_plan_statu=$("[name='check_plan_statu']").val()
        var checkplanId=$("[name='checkplanId']").val()
        var final_approver_name=$("[name='final_approver_name']").val()
        var plan_person_name=$("[name='plan_person_name']").val()
        var history_plan_name=$("[name='history_plan_name']").val()
        $.post("/CheckPlan/updatePassCheck?rankNum="+rankNum+"&check_plan_statu="+check_plan_statu+"&checkplan_id="+checkplanId+"&final_approver_name="+final_approver_name+"&plan_person_name="+plan_person_name+"&history_plan_name="+history_plan_name,function (res) {
            alert(res)
            window.location.href="/jump/goOwnCheckPlan"
        },"text")
    })
    /*不通过*/
    $("#forbidBtn").click(function () {
        var rankNum = $("[name='rankNum']").val()
        var check_plan_statu=$("[name='check_plan_statu']").val()
        var checkplanId=$("[name='checkplanId']").val()
        var final_approver_name=$("[name='final_approver_name']").val()
        var plan_person_name=$("[name='plan_person_name']").val()
        var history_plan_name=$("[name='history_plan_name']").val()
        $.post("/CheckPlan/updateForbidCheck?rankNum="+rankNum+"&check_plan_statu="+check_plan_statu+"&checkplan_id="+checkplanId+"&final_approver_name="+final_approver_name+"&plan_person_name="+plan_person_name+"&history_plan_name="+history_plan_name,function (res) {
            alert(res)
            window.location.href="/jump/goOwnCheckPlan"
        },"text")
    })

   /*保修*/
    $("#repair").click(function () {
        window.location.href="/jump/gobuildScrap"
    })

    /*提交具体的盘点结果*/
    $("#stand").click(function () {
        var formStand=  $("#formStand").serialize();
        var check_id = $("[name='checkplanId']").val()
        $.post("/CheckPlan/addResMar?"+formStand+"&check_id="+check_id,function (res) {
             if(res=="ok"){
                 layer.msg("添加成功！", {
                     time: 60000, //60s后自动关闭
                     btn: ['好的']
                 });
             }
        },"text")
    })

</script>
</html>